package visitor

import (
    "strconv"
)

type visitor interface {
    visitFile(file *file) string
    visitDir(directory *directory) string
}

type element interface {
    Accept(visitor visitor) string
}

type entry interface {
    element
    getName() string
    getSize() string
    Add(entry entry)  
}

type defaultEntry  struct {
    entry
    name string
}

func (self *defaultEntry) getName() string{
    return self.name
}

func (self *defaultEntry) print(entry entry) string {
    return entry.getName() + " (" + strconv.Itoa(entry.getSize()) + ")\n"
}

type file struct {
    *defaultEntry
    size int
}


